package com.barradata

import com.barradata.app0624.validate.isIdBirthday
import com.barradata.app0624.validate.isIdCardNumber
import org.junit.Test

import org.junit.Assert.*


/**
 * Author:    WuNan
 * Email:     wunan@barradata.com
 * Created:   2019/7/13 12:37
 * Description: 数据校验扩展工具单元测试
 **/

class ValidateExtTest {

    @Test
    fun idcardTest() {
        assertTrue("1234123412341234".isIdCardNumber())
        assertFalse("12341234123412345".isIdCardNumber())
        assertFalse("123412341234123".isIdCardNumber())
        assertFalse("".isIdCardNumber())
        assertFalse("a".isIdCardNumber())
        assertFalse("abcdefghabcdefgh".isIdCardNumber())
    }

    @Test
    fun idBirthday() {
        assertTrue("1991.09.28".isIdBirthday())
        assertFalse("1991.9.28".isIdBirthday())
    }

}